﻿using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ExchangeHog.EHCore;

namespace ExchangeHog.IMAPClientTest
{
	/// <summary>
	/// Summary description for IMAPClientTest
	/// </summary>
	[TestClass]
	public class IMAPClientTest
	{
		public IMAPClientTest()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		private TestContext testContextInstance;

		/// <summary>
		///Gets or sets the test context which provides
		///information about and functionality for the current test run.
		///</summary>
		public TestContext TestContext
		{
			get
			{
				return testContextInstance;
			}
			set
			{
				testContextInstance = value;
			}
		}

		#region Additional test attributes
		//
		// You can use the following additional attributes as you write your tests:
		//
		// Use ClassInitialize to run code before running the first test in the class
		// [ClassInitialize()]
		// public static void MyClassInitialize(TestContext testContext) { }
		//
		// Use ClassCleanup to run code after all tests in a class have run
		// [ClassCleanup()]
		// public static void MyClassCleanup() { }
		//
		// Use TestInitialize to run code before running each test 
		// [TestInitialize()]
		// public void MyTestInitialize() { }
		//
		// Use TestCleanup to run code after each test has run
		// [TestCleanup()]
		// public void MyTestCleanup() { }
		//
		#endregion

		[TestMethod]
		public void TestMethod1()
		{
			IMAPClient client = new IMAPClient("imap.server.com", 143, false);
			client.connect();
			client.login("imap_userid", Util.StringToSecureString("imap_password"));
			client.addMessage(
				ASCIIEncoding.ASCII.GetBytes(
@"Return-Path: <update+zj4ocf_6zcfy@facebookmail.com>
Delivered-To: abc@def.com
Received: from localhost (localhost [127.0.0.1])
	by minimac.abc.com (Postfix) with ESMTP id A98FD26DD63F
	for <alexander@abc.com>; Tue, 20 Dec 2011 21:49:42 -0500 (EST)
X-Virus-Scanned: amavisd-new at abc.com
Received: from minimac.abc.com ([127.0.0.1])
	by localhost (minimac.abc.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id OBMRzg7lQiIP for <alexander@abc.com>;
	Tue, 20 Dec 2011 21:49:38 -0500 (EST)
Received: from mx-out.facebook.com (outmail012.snc4.facebook.com [66.220.144.146])
	by minimac.abc.com (Postfix) with ESMTP id DEA9A26DD62B
	for <alexander@abc.com>; Tue, 20 Dec 2011 21:49:37 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; d=facebookmail.com; s=s1024-2011-q2; c=relaxed/simple;
	q=dns/txt; i=@facebookmail.com; t=1324435774;
	h=From:Subject:Date:To:MIME-Version:Content-Type;
	bh=/7ctfWhSVFucXXUDfJ9gT8DKuONoFmTjr5UTHiRv/pE=;
	b=TxG/4HVYsQuIZQ9du4s1vtFOkJcO822wDxjcSs4chGftfVOyOlE7dp3Qo8XAtPqF
	GmzXrwW1KobVkeauhthkOqhABP/l33dB6GZhF95+8c6OzCzUZmePANXmMU79pL/r
	JOZkkV0hpsPIKumlQ9dOQpkGrja+PAOd9RWNF/3q+1c=;
Received: from [10.30.46.204] ([10.30.46.204:34217])
	by smout039.snc4.facebook.com (envelope-from <update+zj4ocf_6zcfy@facebookmail.com>)
	(ecelerity 2.2.2.45 r(34222M)) with ECSTREAM
	id 0E/03-24284-E3941FE4; Tue, 20 Dec 2011 18:49:34 -0800
X-Facebook: from zuckmail ([MTI3LjAuMC4x]) 
	by async.facebook.com with HTTP (ZuckMail);
Date: Tue, 20 Dec 2011 18:49:34 -0800
To: Alexander Aprelev <alexander@abc.com>
From: ""Facebook"" <update+zj4ocf_6zcfy@facebookmail.com>
Reply-to: Facebook <update+zj4ocf_6zcfy@facebookmail.com>
Subject: Alexander, you have notifications pending
Message-ID: <94a32e9d0c80d84c585f8c35e28b9887@async.facebook.com>
X-Priority: 3
X-Mailer: ZuckMail [version 1.00]
X-Facebook-Camp: engage_digest_email
X-Facebook-Notify: engage_digest_email; mailid=55b466cG5af31a634cbcG0Gd4
Errors-To: update+zj4ocf_6zcfy@facebookmail.com
X-FACEBOOK-PRIORITY: 1
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary=""b1_94a32e9d0c80d84c585f8c35e28b9887""


--b1_94a32e9d0c80d84c585f8c35e28b9887
Content-Type: text/plain; charset=""UTF-8""
Content-Transfer-Encoding: quoted-printable

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To login to Facebook, follow the link below:
http://www.facebook.com/n/?home.php&clk_loc=3D7&mid=3D55b466cG5af31a634cbc=
G0Gd4&bcode=3DjehavufC&n_m=3Dalexander%40abc.com
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Hi Alexander,

Here's some activity you may have missed on Facebook.

*  2 friend requests

Pavel Aprelev has posted statuses, photos and more on Facebook.

Thanks,
The Facebook Team

To login to Facebook, follow the link below:
http://www.facebook.com/n/?home.php&clk_loc=3D7&mid=3D55b466cG5af31a634cbc=
G0Gd4&bcode=3DjehavufC&n_m=3Dalexander%40abc.com

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This message was sent to alexander@abc.com. If you don't want to =
receive these emails from Facebook in the future, please follow the link =
below to unsubscribe.
http://www.facebook.com/o.php?k=3Da70863&u=3D100000166268092&mid=3D55b466c=
G5af31a634cbcG0Gd4
 Facebook, Inc. Attention: Department 415 P.O Box 10005 Palo Alto CA =
94303=20


--b1_94a32e9d0c80d84c585f8c35e28b9887
Content-Type: text/html; charset=""UTF-8""
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional =
//EN""><html><head><title>Facebook</title><meta http-equiv=3D""Content-Type"" =
content=3D""text/html; charset=3Dutf-8"" /></head><body style=3D""margin: 0; =
padding: 0;"" dir=3D""ltr""><table cellspacing=3D""0"" cellpadding=3D""0"" =
style=3D""border-collapse:collapse;width:98%;"" border=3D""0""><tr><td =
style=3D""font-size:12px;font-family:&#039;lucida =
grande&#039;,tahoma,verdana,arial,sans-serif;""><table cellspacing=3D""0"" =
cellpadding=3D""0"" style=3D""border-collapse:collapse;width:620px;""><tr><td =
style=3D""font-size:16px;font-family:&#039;lucida grande&#039;,tahoma,verda=
na,arial,sans-serif;background:#3b5998;color:#FFFFFF;font-weight:bold;vert=
ical-align:middle;letter-spacing:-0.03em;text-align:left;padding:10px 38px =
4px;""><a style=3D""text-decoration: none;"" href=3D""http://www.facebook.com/=
n/?home.php&amp;clk_loc=3D9&amp;mid=3D55b466cG5af31a634cbcG0Gd4&amp;bcode=
=3DjehavufC&amp;n_m=3Dalexander%40abc.com""><span style=3D""background:#=
3b5998;color:#FFFFFF;font-weight:bold;font-family:&#039;lucida =
grande&#039;,tahoma,verdana,arial,sans-serif;vertical-align:middle; =
font-size:16px;letter-spacing:-0.03em;text-align:left;"">facebook</span></a=
></td></tr></table><table cellspacing=3D""0"" cellpadding=3D""0"" =
style=3D""border-collapse:collapse;width:620px;""><tr><td =
style=3D""padding:10px 20px;background-color:#fff;border-left:1px solid =
#ccc;border-right:1px solid #ccc;border-top:1px solid =
#ccc;border-bottom:1px solid #ccc;line-height:16px;""><table =
cellspacing=3D""0"" cellpadding=3D""0"" width=3D""100%"" =
style=3D""border-collapse:collapse;""><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:10px =
20px;line-height:16px;width:620px;""><table cellspacing=3D""0"" =
cellpadding=3D""0"" style=3D""border-collapse:collapse;""><tr><td =
style=3D""font-size:13px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;"">Hi Alexander,</td></tr><tr><td =
style=3D""font-size:13px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:10px 0 15px 0;"">Here's some activity =
you may have missed on Facebook.</td></tr><tr><td height=3D""1"" =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;background-color:#ccc;""></td></tr><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;""><table cellspacing=3D""0"" cellpadding=3D""0"" =
style=3D""border-collapse:collapse;""><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:15px 20px 15px 0;""><table =
cellspacing=3D""0"" cellpadding=3D""0"" =
style=3D""border-collapse:collapse;""><tr><td valign=3D""top"" =
style=3D""padding-right: 5px;font-size: 0px;""><img =
src=3D""http://static.ak.fbcdn.net/rsrc.php/v1/yW/r/BwlAapiRmdD.png"" =
style=3D""border:0;"" /></td><td valign=3D""top""><a href=3D""http://www.facebo=
ok.com/n/?reqs.php&amp;clk_loc=3D1&amp;mid=3D55b466cG5af31a634cbcG0Gd4&amp=
;bcode=3DjehavufC&amp;n_m=3Dalexander%40abc.com"" =
style=3D""color:#3b5998;text-decoration:none;font-size:13px;"">2 friend =
requests</a></td></tr></table></td></tr></table></td></tr><tr><td =
height=3D""1"" style=3D""font-size:11px;font-family:&#039;lucida =
grande&#039;, tahoma, verdana, arial, =
sans-serif;background-color:#ccc;""></td></tr><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding-top:15px;""><table cellspacing=3D""0"" =
cellpadding=3D""0"" style=3D""border-collapse:collapse;""><tr><td =
style=3D""font-size:0px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:5px 5px 0px 0px;""><a =
href=3D""http://www.facebook.com/n/?pavpav&amp;clk_loc=3D2&amp;mid=3D55b466=
cG5af31a634cbcG0Gd4&amp;bcode=3DjehavufC&amp;n_m=3Dalexander%40abc.com=
"" style=3D""color:#3b5998;text-decoration:none;""><img width=3D""50"" =
height=3D""50"" src=3D""http://profile.ak.fbcdn.net/hprofile-ak-snc4/369623_6=
44942256_2087563204_q.jpg"" style=3D""border:0;"" =
/></a></td></tr></table></td></tr><tr><td =
style=3D""font-size:12px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:10px 0 15px 0;""><a =
href=3D""http://www.facebook.com/n/?pavpav&amp;clk_loc=3D3&amp;mid=3D55b466=
cG5af31a634cbcG0Gd4&amp;bcode=3DjehavufC&amp;n_m=3Dalexander%40abc.com=
"" style=3D""color:#3b5998;text-decoration:none;"">Pavel Aprelev</a> has =
posted statuses, photos and more on Facebook.</td></tr><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:10px 0 15px 0;""><table =
cellspacing=3D""0"" cellpadding=3D""0"" border=3D""0"" =
style=3D""border-collapse:collapse;width:100%;""><tr><td =
style=3D""padding:10px;background-color:#f2f2f2;border-left:none;border-rig=
ht:none;border-top:1px solid #ccc;border-bottom:1px solid #ccc;""><table =
cellspacing=3D""0"" cellpadding=3D""0"" =
style=3D""border-collapse:collapse;""><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding-right:10px;""><table cellspacing=3D""0"" =
cellpadding=3D""0"" style=3D""border-collapse:collapse;""><tr><td =
style=3D""border-width: 1px; border-style: solid; border-color: #29447E =
#29447E #1a356e; background-color: #5b74a8;""><table cellspacing=3D""0"" =
cellpadding=3D""0"" style=3D""border-collapse:collapse;""><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:4px 10px 5px;border-top:1px solid =
#8a9cc2;""><a href=3D""http://www.facebook.com/n/?home.php&amp;clk_loc=3D5&a=
mp;mid=3D55b466cG5af31a634cbcG0Gd4&amp;bcode=3DjehavufC&amp;n_m=3Dalexande=
r%40abc.com"" style=3D""color:#3b5998;text-decoration:none;""><span =
style=3D""font-weight: bold; color: #fff; font-size: 13px;"">Go To =
Facebook</span></a></td></tr></table></td></tr></table></td><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;""><table cellspacing=3D""0"" cellpadding=3D""0"" =
style=3D""border-collapse:collapse;""><tr><td style=3D""border-width: 1px; =
border-style: solid; border-color: #999 #999 #888; background-color: =
#eee;""><table cellspacing=3D""0"" cellpadding=3D""0"" =
style=3D""border-collapse:collapse;""><tr><td =
style=3D""font-size:11px;font-family:&#039;lucida grande&#039;, tahoma, =
verdana, arial, sans-serif;padding:4px 10px 5px;border-top:1px solid =
#fff;""><a href=3D""http://www.facebook.com/n/?notifications&amp;clk_loc=3D6=
&amp;mid=3D55b466cG5af31a634cbcG0Gd4&amp;bcode=3DjehavufC&amp;n_m=3Dalexan=
der%40abc.com"" style=3D""color:#3b5998;text-decoration:none;""><span =
style=3D""font-weight: bold; color: #333; font-size: 13px;"">See All =
Notifications</span></a></td></tr></table></td></tr></table></td></tr></ta=
ble></td></tr></table></td></tr></table></td></tr></table></td></tr></tabl=
e><table cellspacing=3D""0"" cellpadding=3D""0"" border=3D""0"" =
style=3D""border-collapse:collapse;width:620px;""><tr><td =
style=3D""padding:10px;background-color:#fff;border-left:none;border-right:=
none;border-top:none;border-bottom:none;font-size:11px;font-family:&#039;l=
ucida grande&#039;, tahoma, verdana, arial, =
sans-serif;color:#999999;border:none;"">This message was sent to =
alexander&#064;abc.com. If you don't want to receive these emails from =
Facebook in the future or have your email address used for friend =
suggestions, please click: <a href=3D""http://www.facebook.com/o.php?k=3Da7=
0863&amp;u=3D100000166268092&amp;mid=3D55b466cG5af31a634cbcG0Gd4"" =
style=3D""color:#3b5998;text-decoration:none;"">unsubscribe</a>.<br /> =
Facebook, Inc. Attention: Department 415 P.O Box 10005 Palo Alto CA 94303 =
</td></tr></table><span style=3D""width:620px;""><img src=3D""http://www.face=
book.com/email_open_log_pic.php?mid=3D55b466cG5af31a634cbcG0Gd4"" =
style=3D""border:0;width:1px;height:1px;"" /><bgsound src=3D""http://www.face=
book.com/email_open_log_pic.php?mid=3D55b466cG5af31a634cbcG0Gd4&s=3Da"" =
volume=3D""-10000""/></span></td></tr></table></body></html>



--b1_94a32e9d0c80d84c585f8c35e28b9887--

"));
		}
	}
}
